#include <stdio.h>
#include <stdlib.h>
int main() {
    system("chcp 65001 > nul");
    int a[10][10], i, j;
    for (i = 0; i < 10; i++) {
        a[i][i] = 1;
        a[i][0] = 1;
    }
    for (i = 2;i < 10; i++) {
        for (j = 1;j < i; j++) {
            a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
        }
    }
    printf("10行10列的杨辉三角:\n");
    for (i = 0; i < 10; i++) {
        for (j = 0; j <= i; j++) {
            printf("%3d ", a[i][j]);
        }
        printf("\n");
    }

    return 0;
}